package com.jt.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//RestController= Controller + @ResponseBody
@RestController
//注解的规则:如果注解中只有一个属性,并且名称为value时,则属性名称可以省略
//如果注解的属性有多个,则不能省略
@PropertySource( value = "classpath:/user.properties",encoding="utf-8")
public class HelloController {
    @Value("${userinfo.name}")
    private String name;
    @Value(("${user.info2}"))
    private String name2;
    @RequestMapping("hello")
    public String hello(){
       return "你好SpringBoot:"+name+name2;
    }
}
